package com.os.ui;

import javax.swing.border.AbstractBorder;
import java.awt.*;

public class DashedBottomBorder extends AbstractBorder {
    private final Color color;

    public DashedBottomBorder(Color color) {
        this.color = color;
    }

    @Override
    public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
        super.paintBorder(c, g, x, y, width, height);
        Graphics2D g2d = (Graphics2D) g;
        g2d.setColor(color);
        g2d.setStroke(new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, new float[]{2}, 0));
        g2d.drawLine(x, y + height - 1, x + width, y + height - 1);
    }
}
